package org.luxor.storage.config;

import org.luxor.commons.storage.client.aliyun.AliyunProperties;
import org.luxor.commons.storage.client.disk.DiskProperties;
import org.luxor.commons.storage.client.fastdfs.FastDfsProperties;
import org.luxor.commons.storage.client.qcloud.QcloudProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 *
 * @author Mr.yan @date 2020/3/22
 */
@ConfigurationProperties(prefix = StorageProperties.PREFIX)
public class StorageProperties {
    public static final String PREFIX = "spring.storage";

    final String DEFAULT_DATASOURCE = "master";

    /**
     * 数据源名称
     */
    private String dataSource;

    @NestedConfigurationProperty
    private DiskProperties disk;

    @NestedConfigurationProperty
    private FastDfsProperties fastdfs;

    @NestedConfigurationProperty
    private QcloudProperties qiniu;

    @NestedConfigurationProperty
    private AliyunProperties aliyun;

    @NestedConfigurationProperty
    private QcloudProperties qcloud;

    public StorageProperties() {
        this.dataSource = DEFAULT_DATASOURCE;
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public DiskProperties getDisk() {
        return disk;
    }

    public void setDisk(DiskProperties disk) {
        this.disk = disk;
    }

    public FastDfsProperties getFastdfs() {
        return fastdfs;
    }

    public void setFastdfs(FastDfsProperties fastdfs) {
        this.fastdfs = fastdfs;
    }

    public QcloudProperties getQiniu() {
        return qiniu;
    }

    public void setQiniu(QcloudProperties qiniu) {
        this.qiniu = qiniu;
    }

    public AliyunProperties getAliyun() {
        return aliyun;
    }

    public void setAliyun(AliyunProperties aliyun) {
        this.aliyun = aliyun;
    }

    public QcloudProperties getQcloud() {
        return qcloud;
    }

    public void setQcloud(QcloudProperties qcloud) {
        this.qcloud = qcloud;
    }
}
